package com.syh.jn.scm.domain.supplier.repository.stock;

import cn.redscarf.commons.wrapper.Wrapper;
import com.syh.core.ddd.infrastructure.repository.ReadRepo;
import com.syh.jn.scm.domain.supplier.entity.stock.StockOtherOutBill;
import com.syh.jn.scm.domain.supplier.entity.stock.StockOtherOutBillItem;
import com.syh.jn.scm.dto.supplier.stock.StockOtherOutBillItemVo;

import java.util.List;

/**
 * 其他出库单
 */
public interface StockOtherOutBillReadRepository extends ReadRepo<StockOtherOutBill,Long> {

  /**
   * 重载getById,选择是否包含item
   * @param id
   * @param haveItems
   * @return
   */
  StockOtherOutBill getById(Long id, boolean haveItems);

  /**
   * 根据订单项id获取订单项
   * @param id
   * @return
   */
  StockOtherOutBillItem getItemByItemId(Long id);

  /**
   * 根据出入库单id查找出入库单项
   * @param stockOtherOutBillId
   * @return
   */
  List<StockOtherOutBillItemVo> findStockOtherOutBillItemVoByBillId(Long stockOtherOutBillId);

  /**
   * 分页查找出入库单项
   * @param wrapper
   * @param startRow
   * @param count
   * @return
   */
  List<StockOtherOutBillItemVo> findStockOtherOutBillItemVoListPage(Wrapper wrapper, Integer startRow, Integer count);

  /**
   * 查找出入库单项数量
   * @param wrapper
   * @return
   */
  int findStockOtherOutBillItemVoCount(Wrapper wrapper);

}
